import request from "@/utils/request";
//入库管理Get
//获取采购入库的列表接口
export function GetpurchList(params) {
  const eeear = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/101/0?` + eeear,
    method: "get",
  });
}
//采购入库新增单据编号
export function Getpurchid(data) {
  return request({
    url: "/sys/fillRule/executeRuleByCode/stk_cgrk_bill_no",
    method: "put",
    data,
  });
}

//删除采购入库的列表接口
export const DelpurchList = (id) => {
  return request({
    method: "put",
    url: "/stock/stkIo/void",
    headers: {
      'Content-Type': 'application/json'
    },
    data: JSON.stringify({ id: id })
  });
  
};

//编辑采购入库的列表接口
export const EditpurchList = (data) => {
  const { id } = data;
  const urlParams = new URLSearchParams({
      id
  });
  return request({
      method: "get",
      url: `/stock/stkIo/queryEntryByMainId?${urlParams.toString()}`
  });
};

//获取采购退货的列表接口
export function GettuiList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/1011/1?` + as,
    method: "get",
  });
}

//删除采购入库的列表接口
export const DeltuiList = (id) => {
  return request({
    method: "put",
    url: "/stock/stkIo/void",
    headers: {
      'Content-Type': 'application/json'
    },
    data: JSON.stringify({ id: id })
  });
};


//获取盘盈的列表接口
export function GetpanList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/102?` + as,
    method: "get",
  });
}

//获取涨吨的列表接口
export function GetzhangList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/191?` + as,
    method: "get",
  });
}

//获取其他的列表接口
export function GetqiList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/199?` + as,
    method: "get",
  });
}

  
//出库管理Out
//获取销售出库的列表接口
export function OutpurchList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/201/0?` + as,
    method: "get",
  });
}

//获取销售退货的列表接口
export function OuttuiList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/2011/1` + as,
    method: "get",
  });
}


//获取盘亏出库的列表接口
export function OutkuiList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/202?` + as,
    method: "get",
  });
}

//获取其他出库的列表接口
export function OutqiList(params) {
  const as = new URLSearchParams(params);
  return request({
    url: `/stock/stkIo/list/299?` + as,
    method: "get",
  });
}


